<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>文章列表--layui后台管理模板 2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="resources/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="resources/css/public.css" media="all" />
</head>
<body class="childrenBody">
<form class="layui-form" style="width: 100%" id="dataFrm">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label"><span style="color:red">* </span>客户编号</label>
            <div class="layui-input-inline">
                <input type="text" name="custNo" lay-verify="required"  autocomplete="off" class="layui-input custNo" readonly>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label"><span style="color:red">* </span>客户名称</label>
            <div class="layui-input-inline">
                <input type="text" name="custName" lay-verify="required"   autocomplete="off" class="layui-input custName">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户地区</label>
            <div class="layui-input-block">
                <select id="customerAre" name="custRegion" class="customerGrade" lay-filter="customerAre">
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label"><span style="color:red">* </span>客户经理</label>
            <div class="layui-input-block">
                <select id="custManager" name="custManagerName" class="custManagerGrade" lay-filter="custManager">
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户等级</label>
            <div class="layui-input-block">
                <select id="customerGrades" name="custLevel" class="customerGrade" lay-filter="customerGrades">
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户满意度</label>
            <div class="layui-input-inline">
                <select name="custSatisfy"  lay-search="">
                    <option value="">请选择</option>
                    <option value="1">❤️</option>
                    <option value="2">❤️❤️</option>
                    <option value="3">❤️❤️❤️</option>
                    <option value="4">❤️❤️❤️❤️</option>
                    <option value="5">❤️❤️❤️❤️❤️</option>
                </select>
        </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户信誉度</label>
            <div class="layui-input-inline">
                <select name="custCredit"  lay-search="">
                    <option value="">请选择</option>
                    <option value="1">❤️</option>
                    <option value="2">❤️❤️</option>
                    <option value="3">❤️❤️❤️</option>
                    <option value="4">❤️❤️❤️❤️</option>
                    <option value="5">❤️❤️❤️❤️❤️</option>
                </select>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户地址</label>
            <div class="layui-input-inline">
                <input type="text" name="custAddress"  autocomplete="off" class="layui-input custAddress">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户邮编</label>
            <div class="layui-input-inline">
                <input type="text" name="custZip"  autocomplete="off" class="layui-input custZip">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户传真</label>
            <div class="layui-input-inline">
                <input type="text" name="custFax"   autocomplete="off" class="layui-input custFax">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">办公室电话</label>
            <div class="layui-input-inline">
                <input type="text" name="custTelephone"  autocomplete="off" class="layui-input custTelephone">
            </div>
        </div>
    </div>

    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label">网址:</label>
        <div class="layui-input-block">
            <input type="text" class="layui-input custWebsite" name="custWebsite"  placeholder="">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">营业执照编号</label>
            <div class="layui-input-inline">
                <input type="text" name="custLicencNo"   autocomplete="off" class="layui-input custLicencNo">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户法人</label>
            <div class="layui-input-inline">
                <input type="text" name="custCorporation"  autocomplete="off" class="layui-input custCorporation">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">注册资金</label>
            <div class="layui-input-inline">
                <input type="text" name="custRegisteredCapital"  autocomplete="off" class="layui-input custRegisteredCapital">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">年营业额</label>
            <div class="layui-input-inline">
                <input type="text" name="custTurnover"  autocomplete="off" class="layui-input custTurnover">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">开户银行</label>
            <div class="layui-input-inline">
                <input type="text" name="custBank"  autocomplete="off" class="layui-input custBank">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">银行账号</label>
            <div class="layui-input-inline">
                <input type="text" name="custBankAccount"   autocomplete="off" class="layui-input custBankAccount">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">地税登记号</label>
            <div class="layui-input-inline">
                <input type="text" name="custLocalTaxNo"  autocomplete="off" class="layui-input custLocalTaxNo">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">国税登记号</label>
            <div class="layui-input-inline">
                <input type="text" name="custNationalTaxNo"   autocomplete="off" class="layui-input custNationalTaxNo">
            </div>
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <label class="layui-form-label"><span style="color:red">* </span>客户标识</label>
        <div class="layui-input-block available">
            <input type="radio" name="custFlag" value="1" title="启用" checked>
            <input type="radio" name="custFlag" value="0" title="禁用">
        </div>
    </div>
    <div class="layui-form-item layui-row layui-col-xs12">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-sm" lay-submit="" lay-filter="updateCustomer">立即修改</button>
            <button type="reset" class="layui-btn layui-btn-sm layui-btn-primary">取消</button>
        </div>
    </div>
</form>
<script type="text/javascript" src="resources/layui/layui.js"></script>
<script th:inline="none">
    layui.use(['form','layer','laydate','table','laytpl','upload'],function() {
        var form = layui.form
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            laydate = layui.laydate,
            laytpl = layui.laytpl,
            table = layui.table,
            upload=layui.upload;

        form.render('select');
        form.on("submit(updateCustomer)",function (data) {
            //var index = top.layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
            //实际使用时的提交数据
            var params=$("#dataFrm").serialize();
            console.log(params);
            $.post("customers/update",params,function (res) {
                console.log(res.code);
                if(res.code==2000){
                    //top.layer.close(index);
                    top.layer.msg(res.msg);
                    var index1=parent.layer.getFrameIndex(window.name)
                    parent.layer.close(index1);
                    parent.location.reload();
                }else if(res.code=-2000){
                    layer.msg(res.msg);
                }
            },"json");
            return false;
        });
    });
</script>
</body>
</html>